package com.lxk.config;

import org.springframework.util.ResourceUtils;

import java.io.FileNotFoundException;

/**
 * @author JohnSoybean
 * @create 2020/7/15 10:07
 * @description 链接、路径配置
 */
public class UrlConfig {

    /**
     * CFG 后端服务器域名
     */
    public static final String SERVER_URL = "https://api.noxbase.com/api/";

    /**
     * CFG 测试服务器域名
     */
    public final static String TEST_DOMAIN = "https://api.noxbase.com";

    /**
     * CFG 图片上传 后台前端域名
     */
    public final static String FRONT_URL = TEST_DOMAIN + "/nox";

    /**
     * CFG 图片上传 服务器真实目录
     */
    public final static String SERVER_ADDRESS = "/var/www/html/nox";



    /**
     * 获取项目静态文件绝对路径
     * @return
     */
    public static String getStaticPath() {
        String path = null;
        try {
            path = ResourceUtils.getURL("classpath:static").getPath().replace("%20", " ");
//            path = serverPath.substring(0);//从路径字符串中取出工程路径
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        return path;
    }
}
